نوشته شده توسط : ashley

On Windows 10, setting a static IP address to your computer is a vital configuration which may be required in a number of scenarios: For instance, if you're likely to share files or perhaps a printer on the local network, or when attempting to configure port forwarding.

Should you don't assign a static IP address, the services your pc provides to other devices, or that port forwarding configuration, will ultimately stop working. It is because, by default, connected devices use dynamic IP addresses assigned through the DHCP server (usually your router), which can change once you restart your machine.

In this guide, you'll learn the steps to set a static IP (version 4) address to your Windows 10 device when it's providing a service around the network, or you're simply configuring port forwarding to your device around the router.

How to assign static IP address using Command Prompt

Although using command lines may be challenging for many users, it's among the quickest method to assign a static Ip to a Windows 10 PC.

Open Start.

Look for Command Prompt, right-click the end result and choose the Run as administrator choice to open the console.

Type the next command to see your current networking configuration and press Enter:

ipconfig /all

Under the network adapter note the name of the adapter as well as the following information in these fields:

IPv4
Subnet mask
Default Gateway
DNS Servers

Type the next command to assign a static IP address and press Enter:

netsh interface ip set address name="Ethernet0" static 10.1.2.220 255.255.255.0 10.1.2.1

Within the above command make sure to change Ethernet0 for that name of your network adapter, and also you must change 10.1.2.220 255.255.255.0 10.1.2.1 with the device Ip, subnet mask, and default gateway address that correspond to your network configuration.

Type the following command to set a DNS server address and press Enter:

netsh interface ip set dns name="Ethernet0" static 10.1.2.1

In the above command be sure to change Ethernet0 with the name of the adapter and 10.1.2.1 with the DNS server address of the network.

Type the next command to set an alternate DNS server address and press Enter:

netsh interface ip add dns name="Ethernet0" 8.8.8.8 index=2

In the above command make sure to change Ethernet0 with name of the adapter and 8.8.8.8 with an alternate DNS server address.

Once you complete the steps, you can look at the brand new configuration while using ping command (e.g., ping google.com) to ascertain if the internet is working. Alternatively, you can just open your internet browser and try to navigate to some website to see if the configuration works.

Microsoft is incorporated in the process of retiring netsh from Windows 10, as a result you can start using the NetTCPIP networking module available in PowerShell instead.

How to assign static IP address using User interface

If the Windows Console isn't for you personally, it's still possible to use User interface to alter the IP settings of the Windows 10 PC.

Open Control Panel.

Click on Network and Internet.

Click on Network and Sharing Center.

On the left pane, click on the Change adapter settings link.

Right-click the network adapter and choose Properties.

Choose the Ip address Version 4 (TCP/IPv4) option.

Click on the Properties button.

Select the Use the following Ip option.

Set the IP address (e.g., 10.1.2.220).

Set the Subnet mask. Usually, on a home network, the subnet mask is 255.255.255.0.

Set the Default gateway. This address is usually your router's IP address (e.g., 10.1.2.1).

Under the "Use the following DNS server addresses set Preferred DNS server" section, which is usually your router's Ip, or IP address of the server providing DNS resolutions (e.g., 10.1.2.1).

(Optional) Enter set the Alternative DNS server, which your pc will use whether it can't reach the preferred server.

Click the OK button.

Click the Close button again to close the network adapter properties.

When you complete the steps, you can open your internet browser and check out loading a web site to see if the configuration works.
How to assign static IP address using PowerShell

Windows 10 also includes the PowerShell (version 5) command line platform that allows you to use the NetTCPIP module to manage networking settings, including the capability to alter the Ip settings of your device.

Open Start.

Search for PowerShell, right-click the end result, and choose the Run as administrator option to open the console.

Type the next command to see your present network configuration and press Enter:

Get-NetIPConfiguration

After running the command, note the following information:
InterfaceIndex
IPv4Address
IPv4DefaultGateway
DNSServer

Type the next command to set a static IP address and press Enter:

New-NetIPAddress -InterfaceIndex 4 -IPAddress 10.1.2.220 -PrefixLength 24 -DefaultGateway 10.1.2.1

In the above command be sure to change the InterfaceIndex number with the one akin to your adapter. Change IPAddress with the Ip you need to assign for your device. Only when necessary, change PrefixLength (subnet mask) using the correct bit number. Typically on a home network the setting is 24.

Also, change DefaultGateway with the default gateway address of the network.

Type the next command to assign a DNS server address and press Enter:

Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 10.1.2.1

If you have to set a secondary DNS server address, you should use exactly the same command, and also to add another address simply employ a comma.

Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 10.1.2.1, 8.8.8.8

In the above mentioned command be sure to alter the InterfaceIndex number with the one corresponding to your adapter, and change ServerAddresses with the DNS Ip.

Once you complete the steps, you can test the brand new configuration by opening your web browser and seeking to navigate to some website.

How to assign static IP address using Settings

On Windows 10, you may also change the Ip settings while using Settings app for wireless in addition to wired adapters.

Assigning static Ip for Wi-Fi adapter

To assign a static IP address configuration to some Wi-Fi adapter, use these steps:

Open Settings.

Click on Network & Internet.

Click on Wi-Fi.

Click around the current connection.

Under "IP settings," click the Edit button.

While using drop-down menu, select the Manual option.

Switch on the IPv4 toggle switch.

Set the static IP address.

Set the Subnet prefix length (subnet mask). If your subnet mask is 255.255.255.0, then the subnet prefix length in bits is 24.

Set the Default Gateway address.

Set the most well-liked DNS address.

Set the Alternate DNS address (if applicable).

Click the Save button.

Once you've completed the steps, you can test your settings making use of your internet browser to test opening a website.

Assigning static IP address for Ethernet adapter

To assign a static IP address configuration for an Ethernet (wired) adapter, use these steps:
Important: The opportunity to change networking protocol settings with an Ethernet adapter can be obtained starting Windows 10 version 1903, May 2019 Update, and then releases.

Open Settings.

Click on Network & Internet.

Click on Ethernet.

Click on the current connection.

Under "IP settings," click on the Edit button.

Using the drop-down menu, select the Manual option.

Switch on the IPv4 toggle switch.

Set the static Ip.

Set the Subnet prefix length (subnet mask). If your subnet mask is 255.255.255.0, then the subnet prefix length in bits is 24.

Set the Default Gateway address.

Set the Preferred DNS address.

Set the Alternate DNS address (if applicable).

Click the Save button.

After you complete the steps, you can look at your settings making use of your web browser to test opening a website.

Regardless of the method you utilize, it's recommended to assign an IP address within the network range and outside of the DHCP server scope to permit proper connectivity and avoid address conflicts, as though two devices share the same IP address neither of the two can connect to the web.

If you need help configuring a static Ip on Windows 10, make sure to ask in the Pureinfotech forums.

Although we're focusing this informative guide on Windows 10, you can use the Command Prompt and Control Panel methods on Windows 8.1 and Windows 7.

Update April 23, 2019: This guide was originally published in September 2017, and it's been upgraded to mirror the new changes on Windows 10.





:: بازدید از این مطلب : 548
|
امتیاز مطلب : 0
|
تعداد امتیازدهندگان : 0
|
مجموع امتیاز : 0
تاریخ انتشار : سه شنبه 10 ارديبهشت 1398 | نظرات ()
مطالب مرتبط با این پست
لیست
می توانید دیدگاه خود را بنویسید


نام
آدرس ایمیل
وب سایت/بلاگ
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

آپلود عکس دلخواه: